package com.nameless.controller.api;

import com.nameless.entity.CarInsurance;
import com.nameless.service.CarInsuranceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 陈灰灰
 * @Date: 2023/03/06/9:17
 * @Description:
 */
@RestController
@RequestMapping("/car/api")
public class CarInsuranceController {
    @Autowired
    private CarInsuranceService carInsuranceService;

    /**
     * @Author chh
     *通过汽车Id查询汽车保险
     * @param carId 汽车id
     * @return {@link CarInsurance}
     */
    @RequestMapping("/getInsuranceByCarId/{carId}")
    public CarInsurance getInsuranceByCarId(@PathVariable Integer carId){
        return carInsuranceService.getCarInsuranceByCarId(carId);
    }
}
